package com.open.capacity.salary.dto;

import lombok.Data;

import java.util.List;

@Data
public class GridHeadDataDto {

    public List<ColData> colData;

    public List<String> colNames;

    public List<ColData2> colData2;

    @Data
    public static class ColData {
        private ColData(Builder builder) {
            this.label = builder.label;
            this.name = builder.name;
            this.width = builder.width;
            this.align = builder.align;
            this.children = builder.children;
            this.formatter = builder.formatter;
            this.hidden = builder.hidden;
            this.frozen = builder.frozen;
            this.statistics=builder.statistics;
            this.edit=builder.edit;
            this.sort=builder.sort;
        }

        private String label;
        private String name;
        private Integer width;
        private String align;
        private ColData[] children;
        private String formatter;
        private Boolean hidden;
        private Boolean frozen;
        private Boolean statistics;
        private Builder.Edit edit;
        private Boolean sort;

        public static class Builder {
            private String label;

            private String name;

            private Integer width;

            private String align;

            private ColData[] children;

            private String formatter;

            private Boolean hidden;

            private Boolean frozen;

            private Boolean statistics;

            private Edit edit;

            private Boolean sort;

            public Builder label(String label) {
                this.label = label;
                return this;
            }

            public Builder name(String name) {
                this.name = name;
                return this;
            }

            public Builder width(Integer width) {
                this.width = width;
                return this;
            }

            public Builder align(String align) {
                this.align = align;
                return this;
            }

            public Builder formatter(String formatter) {
                this.formatter = formatter;
                return this;
            }

            public Builder children(ColData[] children) {
                this.children = children;
                return this;
            }

            public Builder hidden(Boolean hidden) {
                this.hidden = hidden;
                return this;
            }

            public Builder frozen(Boolean frozen) {
                this.frozen = frozen;
                return this;
            }

            public Builder sort(Boolean sort) {
                this.sort = sort;
                return this;
            }

            public Builder statistics(Boolean statistics) {
                this.statistics = statistics;
                return this;
            }

            public Builder edit(Edit edit) {
                this.edit = edit;
                return this;
            }

            public ColData build() {
                return new ColData(this);
            }

            @Data
            public static class Edit {
                 public String type;
                 public String change;
            }
        }
    }


    @Data
    public static class ColData2 {
        private ColData2(Builder builder) {
            this.title = builder.title;
            this.field = builder.field;
            this.width = builder.width;
            this.colspan = builder.colspan;
            this.rowspan = builder.rowspan;
            this.checked = builder.checked;
            this.columnId = builder.columnId;
            this.align = builder.align;
        }

        private String title;
        private String field;
        private Integer width;
        private Integer colspan;
        private Integer rowspan;
        private Boolean checked;
        private String columnId;
        private String align;

        public static class Builder {
            private String title;
            private String field;
            private Integer width;
            private Integer colspan;
            private Integer rowspan;
            private Boolean checked;
            private String columnId;
            private String align;

            public Builder title(String title) {
                this.title = title;
                return this;
            }

            public Builder field(String field) {
                this.field = field;
                return this;
            }

            public Builder width(Integer width) {
                this.width = width;
                return this;
            }

            public Builder colspan(Integer colspan) {
                this.colspan = colspan;
                return this;
            }

            public Builder align(String align) {
                this.align = align;
                return this;
            }


            public Builder rowspan(Integer rowspan) {
                this.rowspan = rowspan;
                return this;
            }

            public Builder checked(Boolean checked) {
                this.checked = checked;
                return this;
            }

            public Builder columnId(String columnId) {
                this.columnId = columnId;
                return this;
            }

            public ColData2 build() {
                return new ColData2(this);
            }
        }
    }
}
